import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '@/views/home.vue';
import Main from '@/views/main.vue';
import List from '@/views/list.vue';
import News from '@/views/news.vue';
import Profile from '@/views/profile.vue';

import Detail from '@/views/detail.vue'
Vue.use(VueRouter);
const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Home,
      redirect: '/main',
      children: [
        {
          path: 'main',
          component: Main,
        },
        {
          path: 'list',
          component: List,
        },
        {
          path: 'news',
          component: News,
        },
        {
          path: 'profile',
          component: Profile,
        },
      ],
    },
    {
        name:'detail',
        path:'/detail',
        component: Detail
    }
  ],
});

export default router;
